from BruTile.Extent import Extent
from BruTile.TileSchema import TileSchema

class ConfigOsm(object):
    
    def __init__(self):
        '''Constructor'''
    
    @staticmethod
    def getSchema():
        '''
        resolutions = [156543.033900000,78271.516950000,39135.758475000,19567.879237500, 
            9783.939618750,4891.969809375,2445.984904688,1222.992452344, 
            611.496226172,305.748113086,152.874056543,76.437028271, 
            38.218514136,19.109257068,9.554628534,4.777314267, 
            2.388657133,1.194328567,0.597164283,0.298582141]
        
        '''
        resolutions = [[0,156543.033900000], [1,78271.516950000], [2,39135.758475000], [3,19567.879237500], 
            [4,9783.939618750], [5,4891.969809375], [6,2445.984904688], [7,1222.992452344], 
            [8,611.496226172], [9,305.748113086], [10,152.874056543], [11,76.437028271], 
            [12,38.218514136], [13,19.109257068], [14,9.554628534], [15,4.777314267], 
            [16,2.388657133], [17,1.194328567], [18, 0.597164283], [19,0.298582141]]
        tile_schema = TileSchema()
        tile_schema.name = "OpenStreetMap"
        tile_schema.url = "http://a.tile.openstreetmap.org"
        tile_schema.resolutions = resolutions
        tile_schema.origin_x = -20037508.342789
        tile_schema.origin_y = 20037508.342789
        tile_schema.axis = "AxisInverted"
        tile_schema.extent = Extent(-20037508.342789, -20037508.342789, 20037508.342789, 20037508.342789)
        tile_schema.height = 256
        tile_schema.width = 256
        tile_schema.format = "png"
        tile_schema.src = "EPSG:900913"
        
        return tile_schema
        